Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Aligns MutableDictionaryArray's with MutablePrimitiveArrays with TryPush #981

Merged
merged 3 commits into from
May 7, 2022

Conversation

TurnOfACard
Copy link
Contributor

@TurnOfACard TurnOfACard commented May 6, 2022

Also removes the ability to build an invalid map when pushing individual values. try_push_valid relied on the user pushing a value to the values stack.

Could have contributed to an invalid file was generated and bug found in #976.

Also removes the ability to build an invalid map. try_push_valid relied on the user pushing a value to the values stack.
Copy link
Owner

@jorgecarleitao jorgecarleitao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome. Great find!

}

#[cfg(test)]
mod tests {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this to tests/it/array? we have all our tests there so that the compilation of the crate is not triggered when only the tests change.

Copy link
Contributor Author

@TurnOfACard TurnOfACard May 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that. It will need two new pub functions on MutableDictionaryArray, which are required to test TryPush?

    /// Returns the dictionary map
    pub fn map(&self) -> &HashedMap<u64, K> {
        &self.map
    }
    
    /// Returns the dictionary keys
    pub fn keys(&self) -> &MutablePrimitiveArray<K> {
        &self.keys
    }

I'll also add an explicit return for the doctest to satisfy Miri.

@codecov
Copy link

codecov bot commented May 6, 2022

Codecov Report

Merging #981 (e1f5f65) into main (9a38663) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #981      +/-   ##
==========================================
- Coverage   71.51%   71.42%   -0.10%     
==========================================
  Files         357      357              
  Lines       19696    19739      +43     
==========================================
+ Hits        14086    14098      +12     
- Misses       5610     5641      +31     
Impacted Files Coverage Δ
src/array/dictionary/mutable.rs 76.54% <100.00%> (+3.68%) ⬆️
src/io/parquet/read/deserialize/mod.rs 42.62% <0.00%> (-9.04%) ⬇️
src/bitmap/utils/slice_iterator.rs 87.93% <0.00%> (+1.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a38663...e1f5f65. Read the comment docs.

@jorgecarleitao jorgecarleitao merged commit bfbc071 into jorgecarleitao:main May 7, 2022
@jorgecarleitao jorgecarleitao added the enhancement An improvement to an existing feature label May 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants